function setQueryInfo4Student(){
	return {
		entityAlias : "student",
		whereCondition : "student.clazz.clazzId ='"+$("#editClazzId").val()+"'"
	};
}
function setQueryInfo4StudentSubject(){
	return {
		entityAlias : "studentSubject",
		whereCondition : "studentSubject.student.studentId ='"+$("#editStudentId").val()+"'"
	};
}

function afterSelectRow4Student(rowid, stat){
	$("#editStudentId").val(rowid);
	$('#tableStudentSubject').jqGrid("reloadGrid");
}

function beforeSave4Student(datas){
	var demoClazz = FormUtils.convertSimpleForm2ObjectByName("editFormClazz");
	for(var index=0;index<datas.length;index++){
		datas[index].clazz=demoClazz;
	}
	return true;
}

function beforeSave4StudentSubject(datas){
	var demoStudent = FormUtils.convertSimpleForm2ObjectByName("editFormStudent");
	for(var index=0;index<datas.length;index++){
		datas[index].student=demoStudent;
	}
	return true;
}

function beforeNew4Student(){
	if($('#editStudentId').val()==""){
		alert("请先选择学生");
		return false;
	}else{
		return true;
	}
}

$(window).ready(function(){
	//点击选项卡 触发查询
	$('#aTabItem2').one('click',function(){
		//alert('只触发一次查询');
		$('#tableStudent').jqGrid("reloadGrid");
	});
});